package com.es.disped.dao.mapper;

import com.es.disped.dao.model.HomeworkStudentRel;
import com.es.disped.dao.model.HomeworkStudentRelExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface HomeworkStudentRelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @SelectProvider(type=HomeworkStudentRelSqlProvider.class, method="countByExample")
    long countByExample(HomeworkStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @DeleteProvider(type=HomeworkStudentRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(HomeworkStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Delete({
        "delete from homework_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Insert({
        "insert into homework_student_rel (rel_id, homework_id, ",
        "homework_name, student_id, ",
        "student_name, complate_rate)",
        "values (#{relId,jdbcType=CHAR}, #{homeworkId,jdbcType=CHAR}, ",
        "#{homeworkName,jdbcType=VARCHAR}, #{studentId,jdbcType=CHAR}, ",
        "#{studentName,jdbcType=VARCHAR}, #{complateRate,jdbcType=DOUBLE})"
    })
    int insert(HomeworkStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @InsertProvider(type=HomeworkStudentRelSqlProvider.class, method="insertSelective")
    int insertSelective(HomeworkStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @SelectProvider(type=HomeworkStudentRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="homework_id", property="homeworkId", jdbcType=JdbcType.CHAR),
        @Result(column="homework_name", property="homeworkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="complate_rate", property="complateRate", jdbcType=JdbcType.DOUBLE)
    })
    List<HomeworkStudentRel> selectByExample(HomeworkStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Select({
        "select",
        "rel_id, homework_id, homework_name, student_id, student_name, complate_rate",
        "from homework_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="homework_id", property="homeworkId", jdbcType=JdbcType.CHAR),
        @Result(column="homework_name", property="homeworkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="complate_rate", property="complateRate", jdbcType=JdbcType.DOUBLE)
    })
    HomeworkStudentRel selectByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkStudentRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HomeworkStudentRel record, @Param("example") HomeworkStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkStudentRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HomeworkStudentRel record, @Param("example") HomeworkStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkStudentRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HomeworkStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework_student_rel
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Update({
        "update homework_student_rel",
        "set homework_id = #{homeworkId,jdbcType=CHAR},",
          "homework_name = #{homeworkName,jdbcType=VARCHAR},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_name = #{studentName,jdbcType=VARCHAR},",
          "complate_rate = #{complateRate,jdbcType=DOUBLE}",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(HomeworkStudentRel record);
}